﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DUCover.Core
{
    /// <summary>
    /// Stores the key for the declared entity. 
    /// </summary>
    class DeclEntityKey
    {
        /// <summary>
        /// Represents the global index that uniquely represents this key. 
        /// TODO: Needs to check whether this is sufficient
        /// </summary>
        int globalIndex;

        public DeclEntityKey(int gi)
        {
            this.globalIndex = gi;
        }

        public override bool Equals(object obj)
        {
            if (obj is DeclEntityKey)
            {
                DeclEntityKey other = obj as DeclEntityKey;
                return this.globalIndex == other.globalIndex;
            }

            return false;
        }

        public override int GetHashCode()
        {
            return this.globalIndex;
        }
    }
}
